package service.impl;

import dao.OrderDao;
import service.OrderService;

public class OrderServiceImpl implements OrderService {

    //依赖（业务层依赖于持久层）
    private OrderDao orderDao;
    private String desc; //订单描述

    //set注入 (给依赖变量赋值)
    public void setOrderDao(OrderDao orderDao) {
        this.orderDao = orderDao;
    }
    public void setDesc(String desc) {
        this.desc = desc;
    }

    //构造注入 (给依赖变量赋值)
    public OrderServiceImpl(OrderDao orderDao) {
        this.orderDao = orderDao;
    }

    public OrderServiceImpl(OrderDao orderDao, String desc) {
        this.orderDao = orderDao;
        this.desc = desc;
    }

    public OrderServiceImpl() {
    }

    @Override
    public void show() {
        System.out.println("dao:" + orderDao);
        System.out.println("desc:" + desc);

        System.out.println("-------------------");
    }
}
